<template>
  <div class="static">
    <div class="left">
      <div class="banner">
        <div class="img">
          <img src="@/assets/images/dashboard-banner-left@2x.png" alt="">
          <img src="@/assets/images/dashboard-banner-right@2x.png" alt="">
        </div>
        <img src="@/assets/images/avatar@2x.png" alt="" class="userimg">
        <div>
          <p class="user-title">仓储管理员</p>
          <p class="subject-title">我不是为了输赢，我就是认真！</p>
          <p class="subject-author">—— 罗永浩</p>
          <div class="site">
            <p class="title">北京总仓</p>
          </div>
        </div>
        <!-- <img src="" alt=""> -->
      </div>
      <div class="backlog">
        <div class="subject">待办信息</div>
        <div class="item-list">
          <el-row>
            <el-col v-for="(item, index) in task" :key="index" :span="8">
              <div class="item">
                <div class="icon" :style="index === 1 ? 'background: rgb(255, 178, 0);' : ''" :class="index === 2 ? 'bgc1' : ''">
                  <i v-if="index === 1" class="iconfont icon_db_rukudan2x" />
                  <i v-else-if="index === 2" class="iconfont icon_db_chukudan2x" />
                  <i v-else class="iconfont icon_db_pandiandan2x" />
                  <div class="title">{{ item.name }}</div>
                </div>
                <div class="buttom">
                  <span class="label">新增</span>
                  <span class="value">{{ item.value1 }}</span>
                  <span class="label">待审核</span>
                  <span
                    class="value"
                    style="color: rgb(0, 118, 255);"
                    :style="index === 1 ? 'color: rgb(255, 178, 0);' : ''"
                    :class="index === 2 ? 'color1' : ''"
                  >{{ item.value2 }}</span>
                </div>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
    </div>
    <div class="right">
      <div class="subject">
        <p>通知/公告</p>
        <div class="item">
          <div style="width: 201px;height: 1px; background-color: #f5efee;" />
          <div class="title">紧急盘点通知</div>
          <div class="time">2020.12.30 18:23:14</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { homeTodo } from '@/api'
export default {
  data() {
    return {
      task: []
    }
  },
  async created() {
    const res = await homeTodo()
    this.task = res.data.data
    console.log(this.task)
  }
}
</script>

<style lang="scss" scoped>
.static {
  width: 100%;
  height: 451px;
  display: flex;

  .left {
    width: calc(100% - 261px);
    padding-right: 30px;

    .banner {
      position: relative;
      width: 100%;
      height: 148px;
      background: linear-gradient(270deg, #ffc771, #ffa634);
      box-shadow: 0 0 6px 0 rgb(188 151 69 / 12%);
      border-radius: 12px;

      .img {
        display: flex;
        justify-content: space-between;
        height: 100%;
      }

      .userimg {
        position: absolute;
        top: 31px;
        left: 43px;
        height: 62px;
      }

      .user-title {
        position: absolute;
        left: 36px;
        bottom: 5px;
        font-size: 16px;
        font-weight: 500;
        color: #332929;
        line-height: 22px;
      }

      .subject-title {
        position: absolute;
        font-weight: 500;
        color: #fff;
        line-height: 25px;
        top: 36px;
        left: 200px;
        font-size: 18px;
      }

      .subject-author {
        position: absolute;
        font-weight: 500;
        color: #fff;
        line-height: 25px;
        top: 76px;
        left: 400px;
        font-size: 16px;
      }

      .site {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 147px;
        height: 40px;
        background: #f8f5f5;
        border-radius: 6px;
        opacity: .79;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
      }
    }

    .backlog {
      width: 100%;
      height: 282px;
      background: #fff;
      box-shadow: 0 0 6px 0 rgb(144 142 142 / 17%);
      border-radius: 12px;
      padding: 25px;
      margin-top: 20px;

      .item-list {
        margin-top: 20px;

        .el-col {
          padding: 0 15px;

          .item {
            position: relative;
            height: 186px;
            // line-height: ;
            background: #fbf7f7;
            border-radius: 8px;
            padding: 20px;
            cursor: pointer;
            box-shadow: 0 0 6px 0 rgb(144 142 142 / 17%);

            &:hover {
              background-color: #fff;
            }

            .icon {
              width: 49px;
              height: 49px;
              line-height: 49px;
              background: #0076ff;
              border-radius: 12px;
              text-align: center;

              i {
                font-size: 32px;
                color: #f8f5f5;
              }

              div {
                position: absolute;
                top: 34px;
                left: 85px;
                font-size: 16px;
                font-weight: 500;
                color: #332929;
                line-height: 22px;
              }
            }

            .buttom {
              position: absolute;
              bottom: 20px;

              .label {
                font-size: 14px;
                font-weight: 400;
                color: #887e7e;
                margin-right: 10px;
                vertical-align: super;
              }

              .value {
                font-size: 36px;
                font-weight: 500;
                color: #332929;
                margin-right: 20px;
              }
            }
          }
        }
      }
    }
  }

  .right {
    width: 261px;
    height: 451px;
    background: #fff;
    box-shadow: 0 0 6px 0 rgb(144 142 142 / 17%);
    border-radius: 12px;
    padding: 30px;
  }
}

.subject {
  font-size: 16px;
  font-weight: 600;
  color: #332929;
  line-height: 22px;
  .item{
    margin-top: 15px;
    .title{
      width: 195px;
    height: 18px;
    font-size: 13px;
    font-weight: 400;
    color: #332929;
    line-height: 18px;
    margin-top: 15px;
    }
    .time{
      width: 115px;
    height: 17px;
    font-size: 12px;
    font-weight: 400;
    color: #887e7e;
    line-height: 17px;
    margin-top: 10px;
    }
  }
}

.bgc1 {
  background: rgb(255, 113, 0) !important;
}

.color1 {
  color: rgb(255, 113, 0) !important;
}
</style>
